
from weibo_api.user_api import get_user_info_api
from business.get_user_blog_statistic import get_user_blog_statistic
from domain.UserInfo import UserInfo
from domain.User import User
from domain.UserBlogStatistics import UserBlogStatistics

def get_user(user_id):
    # 1.获取用户的基本信息
    user_info_json = get_user_info_api(user_id)
    user_info = UserInfo(**user_info_json)
    print(user_info.json())
    # assert False
    # 2.获取用户的博客统计信息
    blog_class_list = get_user_blog_statistic(user_id)
    userBlogUserBlogStatistics = UserBlogStatistics(blog_class_list)
    user = User(user_info, userBlogUserBlogStatistics)
    return user

    

